<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>

<head>
  <meta charset="UTF-8">
  <title>资讯页</title>
  <meta name="page-view-size" content="1280*720">
  <link rel="stylesheet" href="../css/base.css">
  <link rel="stylesheet" href="../css/common.css">
  <link rel="stylesheet" href="../css/order.css">
  <script type="text/javascript" src="../lib/js/evm.js"></script>
  <script type="text/javascript" src="../lib/js/Evm_djyw.js"></script>
  <script type="text/javascript" src="../lib/js/key.js"></script>
  <script src="../lib/js/jquery-1.11.1.min.js" type="text/javascript" charset="utf-8"></script>
  <script src="../lib/js/jquery.cookie.js" type="text/javascript" charset="utf-8"></script>
  <script src="../js/api.js" type="text/javascript" charset="utf-8"></script>
  <script src="../js/public.js" type="text/javascript" charset="utf-8"></script>
  <script src="../js/model.js"></script>
  <style>
    .list-bg {
      padding-top: 10px;
    }
    .list-vote.active {
      background: #D66846;
      color: #fff;
    }

    /* .list-vote.active p.ell {
      position: absolute;
      width: auto;
    } */
  </style>
</head>

<body>
  <div class="orderList-bg" id="orderListMain">
    <div class="list-bg">
      <div class="list-con" id="list-con">
      </div>
      <div class="page-show" id="page_show">
        <span id="now_page">0</span>
        /
        <span id="total_page">0</span>
      </div>
    </div>
  </div>

</body>
<script>
  var modelIndex = {
    disUser: false,
    index: 0,//初始位置
    pageSize: 7,
    type: 1,
    listName: 'list-vote', //模块名称
    containerId: 'list-con'//包含模块的标签id
  }


  TV.structure('投票模块')

  function getMessage(page, pageSize, pos, index) {
    var param = {
      page: page,
      pagesize: pageSize,
      status: 1,
      // cid: id,
      // area_id: $.cookie('TV_CST_AREA'),
      // device: 'tv'
    }
    GetDatas('getVote', param, function (err, res) {
      var mess = res.data;
      var str = '';
      console.log(mess)
      if (mess.items.length > 0) {
        for (var i = 0; i < mess.items.length; i++) {
          str += '<div class="list-vote" data-id="' + mess.items[i].id + '"data-status="'+ mess.items[i].status+'">'
          //图片                      
          // var img = '';
          // if (mess.items[i].img == '') {
          //     img = '../images/base1.jpg'
          // } else {
          //     img = API_URL.imgURL + mess.items[i].img
          // }
          // str += '<div class="list-imgBar">'
          // str += "<img class='list-img' src=" + img + ">";
          // str += '</div>'
          //标题
          str += "<div class='list-title'><p class='ell'>" + mess.items[i].title + "</p></div>";
          // str +="<div class='list-brief'>" + mess.items[i].tpe_name + "</div>"
          str += "<div class='list-time'>" + mess.items[i].format_start_time   + "</div>"
          // str += '</div>'

          //点单
          // str += '<div class="list-count">'
          // str += '已点单'
          // str += '<div class="list-number">' + mess.items[i].counts +'次</div>'
          // str += '</div>'
          str += '</div>'
        }
      } else {
        str += '<h1>暂无数据</h1>';
        $('#page_show').css('display', 'none');
      }
      $('#list-con').html(str);
      // $('#page_show').css('display', 'none');
      MessOpt(page, mess.totalpage, pos, index);
      // $('#now_page').html(page)
      // $('#total_page').html(mess.totalpage)
      // right.index = index ? index : pos == 'previous' ? pageSize - 1 : 0;
      // right.initialization();
      // right.toggleFocus(right.index);


    })
    // right.toggleFocus();
  }

  function direEnter(index) {
    var status = $('.active').attr('data-status');
    if (status == 0 || status == 2) {
      TV.PromptMsg("投票未开始或已结束")
      return
    }
    window.location.href = 'D_VoteDetailArticle.html?id=' + $('.active').attr('data-id')+"&model=vote";

  }
</script>
<script type="text/javascript" src="../js/pageList.js"></script>

</html>